package tool

import (
	"beego/redis"
	"math/rand"
)

func GetNickName() string {
	first := []string{"孤傲", "神气", "可爱", "聪明", "勇敢", "机智", "淘气"}
	last := []string{"苹果", "西瓜", "草莓", "芒果", "荔枝", "葡萄", "香蕉"}
	redis.Init()
	for {
		nickname := first[rand.Intn(4)] + last[rand.Intn(4)]
		if redis.SISMEMBER("nickname2", nickname) == 0 {
			redis.SADD("nickname2", nickname)
			return nickname
		}
	}
}
